home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / htmlparser / nsIContentSink.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  136 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla Communicator client code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37. #ifndef nsIContentSink_h___
  38. #define nsIContentSink_h___
  39.  
  40. /**
  41.  * MODULE NOTES:
  42.  * @update  gess 4/1/98
  43.  * 
  44.  * This pure virtual interface is used as the "glue" that connects the parsing 
  45.  * process to the content model construction process.
  46.  *
  47.  * The icontentsink interface is a very lightweight wrapper that represents the
  48.  * content-sink model building process. There is another one that you may care 
  49.  * about more, which is the IHTMLContentSink interface. (See that file for details).
  50.  */
  51. #include "nsISupports.h"
  52. #include "nsString.h"
  53. #include "mozFlushType.h"
  54.  
  55. class nsIParser;
  56.  
  57. #define NS_ICONTENT_SINK_IID \
  58. { 0x94ec4df1, 0x6885, 0x4b1f, \
  59.  { 0x85, 0x10, 0xe3, 0x5f, 0x4f, 0x36, 0xea, 0xaa } }
  60.  
  61. // The base value for the content ID counter.
  62. // Values greater than or equal to this base value are used
  63. // by each of the content sinks to assign unique values
  64. // to the content objects created by them.
  65. #define NS_CONTENT_ID_COUNTER_BASE 10000
  66.  
  67. class nsIContentSink : public nsISupports {
  68. public:
  69.  
  70.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTENT_SINK_IID)
  71.  
  72.   /**
  73.    * This method gets called when the parser begins the process
  74.    * of building the content model via the content sink.
  75.    *
  76.    * @update 5/7/98 gess
  77.    */     
  78.   NS_IMETHOD WillBuildModel(void)=0;
  79.  
  80.   /**
  81.    * This method gets called when the parser concludes the process
  82.    * of building the content model via the content sink.
  83.    *
  84.    * @update 5/7/98 gess
  85.    */     
  86.   NS_IMETHOD DidBuildModel()=0;
  87.  
  88.   /**
  89.    * This method gets called when the parser gets i/o blocked,
  90.    * and wants to notify the sink that it may be a while before
  91.    * more data is available.
  92.    *
  93.    * @update 5/7/98 gess
  94.    */     
  95.   NS_IMETHOD WillInterrupt(void)=0;
  96.  
  97.   /**
  98.    * This method gets called when the parser i/o gets unblocked,
  99.    * and we're about to start dumping content again to the sink.
  100.    *
  101.    * @update 5/7/98 gess
  102.    */     
  103.   NS_IMETHOD WillResume(void)=0;
  104.  
  105.   /**
  106.    * This method gets called by the parser so that the content
  107.    * sink can retain a reference to the parser. The expectation
  108.    * is that the content sink will drop the reference when it
  109.    * gets the DidBuildModel notification i.e. when parsing is done.
  110.    */
  111.   NS_IMETHOD SetParser(nsIParser* aParser)=0;
  112.  
  113.   /**
  114.    * Flush content so that the content model is in sync with the state
  115.    * of the sink.
  116.    *
  117.    * @param aType the type of flush to perform
  118.    */
  119.   virtual void FlushPendingNotifications(mozFlushType aType)=0;
  120.  
  121.   /**
  122.    * Set the document character set. This should be passed on to the
  123.    * document itself.
  124.    */
  125.   NS_IMETHOD SetDocumentCharset(nsACString& aCharset)=0;
  126.  
  127.   /**
  128.    * Returns the target object (often a document object) into which
  129.    * the content built by this content sink is being added, if any
  130.    * (IOW, may return null).
  131.    */
  132.   virtual nsISupports *GetTarget()=0;
  133. };
  134.  
  135. #endif /* nsIContentSink_h___ */
  136.